﻿using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace suirui.ZhuMu.Common
{
    public class SHA256Utils
    {
        public static Byte[] SHA256Encrypt(string StrIn)
        {
            var sha256 = new SHA256Managed();
            //var Asc = new ASCIIEncoding();
            //var tmpByte = Asc.GetBytes(StrIn);
            var EncryptBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(StrIn));
            sha256.Clear();
            return EncryptBytes;
        }
        public static Byte[] SHA256Encrypt2(byte[] StrIn)
        {
            var sha256 = new SHA256Managed();
            //var Asc = new ASCIIEncoding();
            //var tmpByte = Asc.GetBytes(StrIn);
            var EncryptBytes = sha256.ComputeHash(StrIn);
            sha256.Clear();
            return EncryptBytes;
        }
    }
}
